package com.ashapo;

/**
 * 测试进制类
 * @author Administrator
 */
public class Ary {
	
	private int denary;
	
	private String otherd;

	public Ary(int denary, String otherd) {
		this.denary = denary;
		this.otherd = otherd;
	}
	
	public String to16(){
		return Integer.toHexString(denary);
	}
	
	public String to8(){
		return Integer.toOctalString(denary);
	}
	
	public String to2(){
		return Integer.toBinaryString(denary);
	}
	
	public int get10(int ddx){
		return Integer.valueOf(otherd, ddx);
	}
}
